package com.itheima.practice.demo01;

import com.itheima.practice.domain.Student;

import java.util.Objects;

public class MainClass {
    public static void main(String[] args) {
        Student student1 = new Student("张三",23);
        String str1 = Objects.toString(student1);
        System.out.println(str1);

        Student student2 = null;
        String str2 = Objects.toString(student2,"好想去吃饭");
        System.out.println(str2);

        boolean flag1 = Objects.isNull(student1);
        boolean flag2 = Objects.isNull(student2);
        System.out.println(flag1);
        System.out.println(flag2);

        boolean flag3 = Objects.nonNull(student1);
        boolean flag4 = Objects.nonNull(student2);
        System.out.println(flag3);
        System.out.println(flag4);

    }
}
